package com.redside.model.lookup;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.redside.model.list.OptionsBean;

/**
 * This class represents the lookup class that holds the name/value pairs for
 * counties.
 * 
 * @author <a href="mailto:pchapman@redsidesoftware.com">Peter Chapman</a>
 */

@Entity
@Table(name = "county_lkp")
public class CountyLkp implements java.io.Serializable {

    private static final long serialVersionUID = -3197961663614915750L;
    private String countyId;
    private String name;

    public CountyLkp() {
    }

    public CountyLkp(String countyId, String name) {
        this.countyId = countyId;
        this.name = name;
    }

    public CountyLkp(OptionsBean lookup) {
        this.countyId = lookup.getId();
        this.name = lookup.getValue();
    }

    /**
     * @return the county_id
     */
    @Id
    @Column( name="county_id", unique=true, nullable=false, updatable=false )
    public String getCountyId() {
        return countyId;
    }

    /**
     * @param id the id to set
     */
    public void setCountyId(String countyId) {
        this.countyId = countyId;
    }


    @Column(name = "name", nullable = false, length = 50)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
}
